package com.example.bysj_sb.service;

import com.example.bysj_sb.dao.ActorDao;
import com.example.bysj_sb.domain.authority.Actor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service("actorService")
//@Transactional注解：可以用在方法上和类上，用在类上代表这个类的所有公共非静态方法都将启用事务功能。
@Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation. REQUIRED)
public class ActorService {
    @Autowired
    private ActorDao actorDao;
    //添加
    public Boolean add(){
        return actorDao.add();
    }
    //根据id查找
    public Actor find(int id){
        Actor actor = actorDao.find(id);
        return actor;
    };
}
